﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAO;
using DBQLTV;

namespace BUS
{
   public class TacGiaBUS
    {
       TacGiaDAO _tacGiaDAO = new TacGiaDAO();
       public bool InsertTacGia(string TenTacGia)
       {
          return  _tacGiaDAO.InsertTacGia(TenTacGia);
       }
       public bool DeleteTacGia(string TenTacGia)
       {
           return _tacGiaDAO.DeleteTacGia(TenTacGia);
       }
       public List<TACGIA> GetListTacGia()
       {
           return _tacGiaDAO.GetListTacGia();
       }
       public List<string> GetListTenTacGia()
       {
           List<string> result = new List<string>();
           foreach (TACGIA tg in GetListTacGia())
           {
               if (!result.Contains(tg.TenTacGia))
               {
                   result.Add(tg.TenTacGia);
               }
           }
           return result;
       }
       public TACGIA GetTacGia(string TenTacGia)
       {
           return TacGiaDAO.GetTacGiaByName(TenTacGia);
       }  
    }
}
